<template>
    <div>
      <el-transfer
        v-model="bindedId"
        :filterable="true"
        :titles="titles"
        :props="{
          key: 'id',
          label: 'intName'
        }"
        :data="unbindApiList"
        @change="authApiChangeHandler"
        style="width: 100%;">
      </el-transfer>
    </div>
</template>

<script>
    export default {
      name: "ApiSelectMod",
      props: ['intIds'],
      data() {
        return {
          titles: ['未限制', '限制接口'],
          unbindApiList: [],
          bindedId: [],
        }
      },
      mounted() {
        this.queryApis();
      },
      methods: {
        queryApis() {
          let p = {};

          this.api.post('/bucket-system/gateway/api/interface/allList', p)
            .then((result) => {
              this.unbindApiList = result.data;
            });
        },
        authApiChangeHandler() {
          this.$emit('change', this.bindedId);
        },
        init(intIds) {
          this.bindedId = intIds;
        }
      }
    }
</script>

<style rel="stylesheet/scss" lang="scss" scoped>

</style>
